import os
import django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "zhongbao.settings")
django.setup()

from task import tasks
from task.models import PersonalTask
from django.db.models import Q
import time

todayStr = time.strftime('%Y-%m-%d', time.localtime(int(time.time())))
taskQueue = PersonalTask.objects.filter(Q(status_id=5)| Q(status_id=4)).exclude(description__contains=todayStr).values('id').order_by(
            'submit_flag')
tid = taskQueue[0].get('id', '')
print(tid)
# tid = taskQueue[1].get('id', '')
# print(tid)
tasks.conf_test(0, tid)
